import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author panjunan <panjunan@kuaishou.com>
 * Created on 2021-03-02
 */
public class Huawei {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        List<Server> serverList = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            String s = scan.nextLine();
            s = s.substring(1, s.length() - 1);
            String[] strings = s.split(",");
            for (int j = 0; j < strings.length; j++) {
                strings[j] = strings[j].trim();
            }
            Server server = new Server();
            server.type = strings[0];
            server.core = Integer.parseInt(strings[1]);
            server.memory = Integer.parseInt(strings[2]);
            server.deviceCost = Integer.parseInt(strings[3]);
            server.dayCost = Integer.parseInt(strings[4]);
        }


        int m = scan.nextInt();
        for (int i = 0; i < m; i++) {
            String s = scan.nextLine();
            s = s.substring(1, s.length() - 1);
            String[] strings = s.split(",");
            for (int j = 0; j < strings.length; j++) {
                strings[j] = strings[j].trim();
            }
            Client client = new Client();
            client.type = strings[0];
            client.core = Integer.parseInt(strings[1]);
            client.memory = Integer.parseInt(strings[2]);
            client.flag = Integer.parseInt(strings[3]);
        }

        int t = scan.nextInt();
        for (int i = 0; i < t; i++) {
            int r = scan.nextInt();
            for (int j = 0; j < r; j++) {
                String s = scan.nextLine();
                s = s.substring(1, s.length() - 1);
                String[] strings = s.split(",");
                for (int k = 0; k < strings.length; k++) {
                    strings[k] = strings[k].trim();
                }
                if ("add".equals(strings[0])) {

                } else{

                }

            }
            Client client = new Client();
//            client.type = strings[0];
//            client.core = Integer.parseInt(strings[1]);
//            client.memory = Integer.parseInt(strings[2]);
//            client.flag = Integer.parseInt(strings[3]);
        }
    }
}

class Server {
    String type;
    int core;
    int memory;
    int deviceCost;
    int dayCost;

}

class Client {
    String type;
    int core;
    int memory;
    int flag;
}
